unit Pl_Consts;
{$IFDEF FPC}
{$mode delphi}
{$ENDIF}

interface
uses Classes;
const
  eq_maxcnt = 18;
  filt_playlist = 'playlist|*.m3u;|playlist unicode|*.m3u8';
  filt_equalizer = 'peq|*.peq';
//const ex_maxcnt = 11;
const
  ENGINE_FFT_DATA_1024 = $80000002;
  VIS_DIR = 'visuals';
  {$IFDEF MSWINDOWS}
    VIS_EXT = '*.dll';
    VIS_EXT_N = 'dll';
  {$ELSE}
     VIS_EXT_N = 'so';
     VIS_EXT = '*.so';
  {$ENDIF}

  WAVE_LEN = 2048;
  FFT_LEN = 512;
  {$IFDEF LINUX}
    _slash  = '/';
    {$ELSE}
     _slash = '\';
  {$ENDIF}
{$IFDEF MSWINDOWS}
  _UNAVALIBLE_NAME = 'con';
  {$ELSE}
  _UNAVALIBLE_NAME = '/root/.bash_history';
  {$ENDIF}
type
  TWAVEDATA = array[1..WAVE_LEN] of CARDINAL;
  TFFTDATA = array[1..FFT_LEN] of SINGLE;
var
   filt_playable: string = 'BASS built-in *.mp3;*.mp2;*.mp1;*.ogg;*.wav;*.aif)\0*.mp3;*.mp2;*.mp1;*.ogg;*.wav;*.aif' + '|'
    + '*.mp3;*.mp2;*.mp1;*.ogg;*.wav*;*.aif';
    sp_exts, eq_exts, pl_exts: TstringList;

function eqexts_Find(const obj: string): boolean;
function spexts_Find(const obj: string): boolean;
function plexts_Find(const obj: string): boolean;

implementation
function eqexts_Find(const obj: string): boolean;
var
  id: Longint;
begin
  eq_exts.Sort;
  eqexts_FIND := eq_exts.Find(obj, id);
end;

function spexts_Find(const obj: string): boolean;
var
  id: Longint;
begin 
  sp_exts.Sort;
  spexts_Find := sp_exts.Find(obj, id);
end;

function plexts_Find(const obj: string): boolean;
var
  id: Longint;
begin
  pl_exts.Sort;
  plexts_Find := pl_exts.Find(obj, id);
end;

procedure sp_exts_init;
begin
  sp_exts := TstringList.Create;
  sp_exts.Append('mp3');
  sp_exts.Append('mp2');
  sp_exts.Append('mp2');
  sp_exts.Append('mp1');
  sp_exts.Append('wav');
  sp_exts.Append('aif');
  sp_exts.Append(VIS_EXT_N);
end;

procedure eq_exts_init;
begin
  eq_exts := TstringList.Create;
  eq_exts.Append('peq');
end;

procedure pl_exts_init;
begin
  pl_exts := TstringList.Create;
  pl_exts.Append('m3u');
  pl_exts.Append('m3u8');
end;

initialization
  sp_exts_init;
  pl_exts_init;
  eq_exts_init
finalization
  sp_exts.FreeInstance;
  pl_exts.FreeInstance;
  eq_exts.FreeInstance
end.

